import sys
from PyQt5.QtWidgets import QApplication, QStackedWidget
from MainWindow import MainWindow
from SendWindow import SendWindow
from ReceiveWindow import ReceiveWindow

class Container(QStackedWidget):
    def __init__(self):
        super(Container, self).__init__()

        self.main_window = MainWindow(self)
        self.send_window = SendWindow(self)
        self.receive_window = ReceiveWindow(self)
        self.addWidget(self.main_window)
        self.addWidget(self.send_window)
        self.addWidget(self.receive_window)

        self.setCurrentIndex(0)

        self.show()

    def change_view(self, page_index):
        if page_index in (0, 1, 2): # 如果后面新添加页面的话，这里是需要改的
            self.setCurrentIndex(page_index)



def main():
    app = QApplication(sys.argv)
    Container()
    sys.exit(app.exec())

if __name__ == '__main__':
    main()